# coding=utf-8

import D2Ext

from framework.singleton import Singleton
from gui.CPanel import CPanel
from gui.CButton import CButton
from gui.CHBoxLayout import CHBoxLayout

@Singleton
class SkillPage:

    def __init__(self):
        self.background = CPanel()
        self.background.set_image("data\\SJ_PATH\\SPELL\\skill_ama_a", 0, 4)

        test_button1 = CButton()
        test_button1.set_image("data\\SJ_PATH\\Metro\\BigButton")
        test_button1.set_hover_text("This is a button!")
        # test_button.connect(CWidget.SIGNAL_ONCLICK, on_click_widget1)
        test_button1.set_position(0, 210)
        test_button1.set_button_frame(0, 1)
        # test_button1.set_text(u"弓和十字弓")

        test_button2 = CButton()
        test_button2.set_image("data\\SJ_PATH\\Metro\\BigButton")
        test_button2.set_hover_text("This is a button!")
        # test_button.connect(CWidget.SIGNAL_ONCLICK, on_click_widget1)
        test_button2.set_position(0, 210)
        test_button2.set_button_frame(0, 1)
        # test_button2.set_text(u"被动和魔法")

        test_button3 = CButton()
        test_button3.set_image("data\\SJ_PATH\\Metro\\BigButton")
        test_button3.set_hover_text("This is a button!")
        # test_button.connect(CWidget.SIGNAL_ONCLICK, on_click_widget1)
        test_button3.set_position(0, 210)
        test_button3.set_button_frame(0, 1)
        # test_button3.set_text(u"标枪和长矛")

        hbox = CHBoxLayout(self.background)

        hbox.addWidget(test_button1)
        hbox.addWidget(test_button2)
        hbox.addWidget(test_button3)

    def show(self):
        self.background.draw()

    def show_ama(self):
        pass
